package com.qk.common.enums;

/**
 * 响应状态码枚举
 */
public enum ResponseCode {
    // 成功
    SUCCESS(200, "成功"),
    DATABASE_ERROR(501, "数据库异常"),
    
    // 客户端错误
    BAD_REQUEST(400, "请求参数错误"),
    UNAUTHORIZED(401, "未授权"),
    FORBIDDEN(403, "禁止访问"),
    NOT_FOUND(404, "资源不存在"),
    
    // 服务端错误
    INTERNAL_ERROR(500, "服务器内部错误"),
    SERVICE_UNAVAILABLE(503, "服务不可用"),
    
    // 业务相关错误
    BUSINESS_ERROR(1000, "业务处理失败"),
    PARAMETER_ERROR(1001, "参数校验失败"),
    DATA_NOT_FOUND(1002, "数据不存在");
    
    private final int code;
    private final String message;
    
    ResponseCode(int code, String message) {
        this.code = code;
        this.message = message;
    }
    
    public int getCode() {
        return code;
    }
    
    public String getMessage() {
        return message;
    }
}
